<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>维护合同费用条款</title>
    <link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
    <link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__STATIC__/layout/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="__STATIC__/layout/css/channel.css?v=4.1.0" rel="stylesheet">
    <!-- Sweet Alert -->
    <link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
</head>

<body class="white-bg" style="padding: 3px;font-size: 13px">
    <div class="page-heade">
        <h2 class="title_color text-center">维护合同费用条款</h2>
    </div>
        <table class="table table-bordered bud_hei">
           <tr>
               <td class="text-right">合同费用条款编号：</td>
               <td>{$data['termsNo']}</td>
               <td class="text-right">包含经销商数：</td>
               <td>{$data['jxsnum']}</td>
               <td class="text-right">合同周期</td>
               <td>{$data['startDate']}至{$data['endDate']}</td>
           </tr>
           <tr>
              <td class="text-right">合同费用条款名称：</td>
              <td>{$data['termsName']}</td>
              <td class="text-right">包含费用条款数：</td>
              <td colspan="3">{$data['termnum']}</td>
           </tr>
        </table>
        <div class="div-bottom">
            <div class="padding-10">
                <!--<button type="button" class="btn btn-info btn-sm" id="addContract">添加合同费用条款</button>-->
                <button type="button" class="btn btn-info btn-sm"><a href="{:url('Contractcostterms/addcontract')}?id={$data.id}"class="actionA">添加合同费用条款</a></button>
                <!--<a href="{:url('Contractcostterms/contractfreecase')}?id="class="actionA">修改</a>-->
            </div>
             <table class="table table-bordered bud_hei text-center">
                <thead>
                    <tr class="info">
                        <th class="text-center">操作</th>
                        <th class="text-center">费用科目</th>
                        <th class="text-center">处理方式</th>
                        <th class="text-center">频率</th>
                        <th class="text-center">支付方式</th>
                        <th class="text-center">费用条款</th>
                        <th class="text-center">备注</th>
                    </tr>
                </thead>
                <tbody>
                {volist name="terms" id="list"}
                    <tr>
                        <td><a  href="{:url('Contractcostterms/addcontract')}?contractid={$list['id']}" id="modify">修改</a>&nbsp;&nbsp;<a onclick="shanchu({$list['id']},{$data['id']})">删除</a></td>
                        <td>
                             {$list.controlType}
                        </td>
                        <td>
                             {$list.processWay}
                        </td>
                        <td>
                            {$list.Frequency}
                        </td>
                        <td>
                             {$list.paymethod}
                        </td>
                        <td class="text-left">
                            <!--小于80.0%返利4.0%；大于81.0%返利5.0%；--> {$list.info}
                        </td>
                        <td>{$list.des}</td>
                    </tr>
                {/volist}
                </tbody>
             </table>
             <div class="padding-10 text-center">
                 <button class="btn btn-warning btn-sm" type="button" onclick="gobank()">返回</button>
             </div>
        </div>
   
    <!-- 全局js -->
    <script src="__STATIC__/layout/js/jquery.min.js"></script>
    <script src="__STATIC__/layout/js/contabs_sub.js"></script>
    <script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- Sweet alert -->
    <script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="__STATIC__/layout/js/contabs_sub.js"></script>
     <script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
     <script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>

    <script>
    $(function() {
        $('body').on('click', 'input[type=text]', function() {
            this.select()
        })
    })
   
    

    $("#addContract").click(function() {
        layer.open({
            type: 2,
            title: '新增合同费用条款',
            area: ['1000px', '600px'],
            fixed: false, //不固定
            maxmin: true,
            //content: "{:url('Other/addcontract')}"
            content: "{:url('Contractcostterms/addcontract')}"
        });
        return false
    });
 
    function  gobank() {
        history.go(-1)
    };
    function shanchu(id,contractid){
        swal({
                title: "确定此操作吗？",
                text: "",
                type: "warning",
                showCancelButton: true,
                confirmButtonColor: "#DD6B55",
                confirmButtonText: "确定！",
                closeOnConfirm: false
            },
            function () {

                $.post("{:url('Contractcostterms/del')}",{id:id},function(re){
                    if(re==1){
                        swal({
                            title: "成功",
                            text:  "操作已完成",
                            type: "success"
                        },function(){
                            location.href="{:url('contractcostterms/maintenanceclause')}?id="+contractid;
                        });
                    }else{
                        swal({
                            title: "错误",
                            text:  "您没有选择要删除的明细",
                            type: "warning"
                        });
                    }
                })

            });

    }

    function xiugai(id) {


    }

    </script>
</body>

</html>